<div class="judul_content">Data Detail Order</div>
            
<?php
	$id=$_GET['id'];
	$sttmt = $koneksi->query("select * from orders o inner join status s on o.id_status = s.id_status inner join kabupaten k on o.id_kabupaten = k.id_kabupaten where o.id_orders = '$id'");
	$hasil = $sttmt->fetch(PDO::FETCH_ASSOC);
?>
<table>
    <tr>
        <td width="100">ID Order</td>
        <td width="5">:</td>
        <td width="350"><?php echo $hasil['id_orders']; ?></td>
        <td width="100">Email</td>
        <td width="5">:</td>
        <td width="250"><?php echo $hasil['email']; ?></td>
    </tr>
    <tr>
        <td>ID Member</td>
        <td>:</td>
        <td><?php echo $hasil['id_member']; ?></td>
        <td>No. Telp</td>
        <td>:</td>
        <td><?php echo $hasil['no_telp']; ?></td>
    </tr>
    <tr>
        <td>Alamat</td>
        <td>:</td>
        <td><?php echo $hasil['alamat']; ?></td>
        <td>Resi</td>
        <td>:</td>
        <td><?php echo $hasil['resi']; ?></td>
    </tr>
    <tr>
        <td>Kota</td>
        <td>:</td>
        <td><?php echo $hasil['kabupaten']; ?></td>
        <td>Keterangan</td>
        <td>:</td>
        <td><?php echo $hasil['keterangan']; ?></td>
    </tr>
    <tr>
        <td>Kode Pos</td>
        <td>:</td>
        <td><?php echo $hasil['kode_pos']; ?></td>
        <td>Status</td>
        <td>:</td>
        <td><?php echo $hasil['status']; ?></td>
    </tr>
</table>
<br><br>
<table class="table" border="1">
	<tr>
		<th>No</th>
		<th>Nama Barang</th>
		<th>Ukuran</th>
		<th>Harga</th>
		<th>Diskon</th>
		<th>Kuantitas</th>
		<th>Subtotal</th>
	</tr>
<?php
	$detail = $koneksi->query("select * from order_detail o inner join ukuran u on o.id_ukuran = u.id_ukuran inner join produk p on p.id_produk = o.id_produk where o.id_orders = '$id'");
	while($dt = $detail->fetch(PDO::FETCH_ASSOC)){
		$no++;
	echo "<tr>
			<td>$no</td>
			<td>$dt[nama_produk]</td>
			<td>$dt[ukuran]</td>
			<td>".harga($dt['harga'])."</td>
			<td>$dt[diskon]</td>
			<td>$dt[jumlah]</td>";
			$subtotal = $dt['harga'] * $dt['jumlah'] - ($dt['diskon']*$dt['harga']/100) ;
		echo "<td>".harga($subtotal)."</td>
		</tr>";
        $total = $total + $subtotal;
	}
    echo "<tr>
            <td colspan='6'><b>Total</b></td>
            <td><b>".harga($total)."</b></td>
        </tr>
    </table>";
?>